from flask import Flask
from flask_cors import CORS

from routes import user, weibo, analyse, llm, documentation  # 从 routes 包中导入 main 蓝图

# 创建 Flask 应用对象
app = Flask(__name__)
CORS(app)  # 允许所有跨域请求

app.register_blueprint(user, url_prefix='/user')
app.register_blueprint(weibo, url_prefix='/weibo')
app.register_blueprint(analyse, url_prefix='/analyse')
app.register_blueprint(llm, url_prefix='/llm')
app.register_blueprint(documentation, url_prefix='/documentation')




# 只有在直接运行该文件时，才启动 Flask 服务器
if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5005)
